package masterjava.common.exception;

import masterjava.common.type.FaultInfoType;

/**
 * User: GKislin
 * Date: 14.01.2011
 */

public enum CommonExceptionType implements FaultInfo {

    DB_ERROR("Exception in DataBase"),
    INTERNAL_ERROR("Exception in Service"),
    VALIDATION_ERROR("Validation exception"),
    CLIENT_UNAVAILABLE("Client Unavailable");

    private String message;

    CommonExceptionType(String message) {
        this.message = message;
    }

    public FaultInfoType getFaultInfo() {
        return new FaultInfoType(name());
    }

    public String getMessage() {
        return message;
    }
}
